<HTML><HEAD><TITLE>http_client(+Method, +Uri, +ObjectBody, +HttpParams, -RespError, -RespParam, -RespObjectBody)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">library(http_client)</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>http_client(+Method, +Uri, +ObjectBody, +HttpParams, -RespError, -RespParam, -RespObjectBody)</H1>
Used to access HTML pages, given their URI (the method GET is applied)
<DL>
<DT><EM>Method</EM></DT>
<DD>A string
</DD>
<DT><EM>Uri</EM></DT>
<DD>A string
</DD>
<DT><EM>ObjectBody</EM></DT>
<DD>A string
</DD>
<DT><EM>HttpParams</EM></DT>
<DD>A list of terms as defined in the DCG grammar
</DD>
<DT><EM>RespError</EM></DT>
<DD>Outputs a term error(ErrorCode, ErrorPhrase),
	where ErrorCode is he error code contained in the response
	and ErrorPhrase is the error phrase contained in the response
</DD>
<DT><EM>RespParam</EM></DT>
<DD>Outputs a list of terms as defined in the DCG grammar
</DD>
<DT><EM>RespObjectBody</EM></DT>
<DD>Outputs the object body of the response
</DD>
</DL>
<H2>Examples</H2>
<PRE>
    [eclipse 1]: use_module(http).
    http_grammar.pl compiled traceable 25048 bytes in 0.38 seconds
    http_client.pl compiled traceable 5916 bytes in 0.47 seconds
    http_server.pl compiled traceable 5304 bytes in 0.07 seconds
    http.pl    compiled traceable 0 bytes in 0.57 seconds

    yes.
    [eclipse 2]:  http_client("GET", "http://www.ecrc.de/staff/", "", [],
	    Status, Param, Resp).

    Status = error(200, "Document follows ")
    Param = [date, server, contentType(mt(text, html))]

    Resp = "&lt;HTML&gt;...&lt;/HTML&gt;"

    yes.
    </PRE>

</BODY></HTML>
